#include <iostream>  
using namespace std;  
  
int main() {  
    int n, count = 0;  
    cout << "请输入一个正整数n：";  
    cin >> n;  
    for (int i = 2; i <= n; i++) {  
        bool isPrime = true;  
        for (int j = 2; j < i; j++) {  
            if (i % j == 0) {  
                isPrime = false;  
                break;  
            }  
        }  
        if (isPrime) {  
            count++;  
        }  
    }  
    cout << "在1到" << n << "之间，素数的个数为：" << count << endl;  
    return 0;  
}
